package com.lolongmaps.main;

import com.lolongmaps.test.R;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;

public class SplashScreen extends Activity {
	
	MediaPlayer splashSound;
	public boolean connected;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		
		splashSound = MediaPlayer.create(SplashScreen.this, R.raw.hallelujahsplashshort);
		splashSound.start();
		
		Thread timer = new Thread(){
			
			public void run(){
				try{
					sleep(2000);
				} catch(InterruptedException e){
					e.printStackTrace();
				} finally{
					Intent homepage = new Intent("com.lolongmaps.main.HOMESCREENVIEW");
					startActivity(homepage);
				}
			}
			
		};
		
		timer.start();
		
	}

	@Override
	protected void onPause(){
		super.onPause();
		splashSound.release();
		finish();
		
	}

}
